package com.zhlab.ssm.demo.web;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.core.PriorityOrdered;
import org.springframework.stereotype.Component;

/**
 * @ClassName TestBeanPostProcessor
 * @Description //TestBeanPostProcessor
 * @Author singleZhang
 * @Email 405780096@qq.com
 * @Date 2021/1/22 0022 下午 5:16
 **/
@Component
public class TestBeanPostProcessor implements BeanPostProcessor {



    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("TestBeanPostProcessor#postProcessBeforeInitialization");
        System.out.println(beanName);

        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("TestBeanPostProcessor#postProcessAfterInitialization");
        System.out.println(beanName);

        return bean;
    }
}
